﻿try {
    var hash = document.location.hash.substring(1);  //解析hash得到access_token值。
    alert(hash);
//    var hash = 'access_token=2.00FTmXrCUIiAiD186af8f9fesNImLD&expires_in=86400&remind_in=80031&uid=2623462611';
    // var url = 'GateService.aspx?op=0&' + hash;
    $.ajax({
        type: "GET",
        url: "/login.aspx",
        dataType: "text",
        async: false,
        data: "op=0&" + hash + "&random=" + new Date().toLocaleString(),
        beforeSend: function (xmlHttpRequest) {
        },
        success: function (data, textStatus) {
            alert(data);
            if (parseInt(data) == 1) {
                //window.opener.sendToActionScript();
                window.close();
            }
        },
        complete: function (xmlHttpRequest, textStatus) {

        },
        error: function () {
            alert("error");
        }
    });
}
catch (e) {
    alert("exception: " + e.Message);
}
